<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* ****************************************************************************
  NAIYUMIE KING WANG JJANG Front End Developer <naiyumie@gmail.com>
  FileType:CRLF, Encording:UTF-8, Tab&Space:4/4
  ------------------------------------------------------------------------
  리디렉션 관련 클래스
**************************************************************************** */

class Nmover {

	private $CI;
	private $nameValues = array();

	public function __construct() {
		$this->CI =& get_instance();
	}

	public function jsLink($argsArray = array()){
		$retVal = 'window.location.href=\'';
		$qStr = '';
		if(is_array($argsArray['queryString'])){
			$qStr .= '?';
			$i = 0;
			foreach($argsArray['queryString'] as $key=>$val){
				if($i != 0){
					$qStr .= '&';
				}
				$qStr .= $key . '=';
				$qStr .= $this->CI->nurl->encrypt($val);
				$i++;
			}
		}
		$retVal .= sprintf('/%s/%s/%s\';',$argsArray['seg1'], $argsArray['seg2'], $qStr);
		return $retVal;
	}

	public function jsBack(){
		return $retVal = 'history.go(-1);';
	}
}